﻿using WorkflowCore.Interface;

namespace WebAPI.Areas.Demo.Controllers
{
    [ApiVersion("1.0")]
    public class WorkflowController : DemoBaseController
    {
        public IWorkflowHost Host { get; set; }

        [HttpGet]
        [Route("Sample03"), MapToApiVersion("1.0")]
        public async Task<IActionResult> Sample03_V1_0()
        {
            var initialData = new WorkflowCore.Sample03.MyDataClass
            {
                Value1 = 2,
                Value2 = 3
            };

            Host.StartWorkflow("PassingDataWorkflow", 1, initialData);

            var initialData2 = new Dictionary<string, int>
            {
                ["Value1"] = 7,
                ["Value2"] = 2
            };

            Host.StartWorkflow("PassingDataWorkflow2", 1, initialData2);

            return Ok("ok!");
        }

    }
}
